package cz.muni.fi.pb138.eis_core;

/**
 * Representation of an exposition.
 * 
 * @author Jakub Senko
 */
public class ExpositionEntity
{
    private long id;
    
    private String name;
    
    /**
     * Basic constructor
     */
    public ExpositionEntity(){}
    
    /**
     * Sets id of the entity.
     * @param id id of the entity
     */
    public void setId(long id)
    {
        this.id = id;
    }
    
    /**
     * Gets id of the entity.
     * 
     * @return id of the entity
     */
    public long getId()
    {
        return id;
    }
    
    /**
     * Sets name of the entity.
     * 
     * @param name name of the entity
     */
    public void setName(String name)
    {
        this.name = name;
    }
    
    /**
     * Gets name of the entity.
     * 
     * @return name of the entity
     */
    public String getName()
    {
        return name;
    }
    
    @Override
    public String toString()
    {
        return "[id=" + id + ", name=" + name + "]";
    }
    
    @Override
    public boolean equals(Object o) {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;

       ExpositionEntity entity = (ExpositionEntity) o;

       if (id != entity.id) return false;

       return true;
    }

    @Override
    public int hashCode()
    {
        int hash = 5;
        hash = 79 * hash + (int) (this.id ^ (this.id >>> 32));
        return hash;
    }
}
